#include "../inc/domain.h"
#include "../inc/topology.h"

/*
 * By default the system creates a single root-domain with all CPUs as
 * members (mimicking the global state we have today).
 */
static struct root_domain def_root_domain;

static void __rq_attach_root(struct rq *rq, struct root_domain *rd)
{
    atomic_inc(&rd->refcount);
    rq->rd = rd;

    cpumask_set_cpu(rq->cpu, rd->span);
    if (cpu_active(rq->cpu))
        set_rq_online(rq);
}

static int init_rootdomain(struct root_domain *rd)
{
    return 0;
}

void __init init_defrootdomain(void)
{
    init_rootdomain(&def_root_domain);

    atomic_set(&def_root_domain.refcount, 1);
}

int sched_init_domains(void)
{
    return 0;
}

void rq_attach_root(struct rq *rq, struct root_domain *rd)
{
}

void rq_attach_root_default(struct rq *rq)
{
    __rq_attach_root(rq, &def_root_domain);
}
